Imports Microsoft.VisualBasic

Namespace MyDAO
    Public Class MyDataColumn
        Public Expression As MyDataExpressionBase
        Public AliasName As String

        Public Sub New(ByVal columnName As String)
            Me.Expression = New MyColumnExpression(columnName)
        End Sub

        Public Sub New(ByVal aliasName As String, ByVal columnName As String)
            Me.New(columnName)
            Me.AliasName = aliasName
        End Sub

        Public Overrides Function ToString() As String
            If Me.AliasName = "" Then
                Return Expression.ToString()
            Else
                Return String.Format("{1} as {0}", Me.AliasName, Me.Expression)
            End If

        End Function
    End Class
End Namespace
